package nl.txproductions.twitterclient;

import javax.swing.JFrame;
import javax.swing.JList;

import nl.txproductions.twitterclient.gui.MainWindow;
import nl.txproductions.twitterclient.gui.MessageJList;
import nl.txproductions.twitterclient.model.Message;
import nl.txproductions.twitterclient.threading.CustomThreadPoolExecutor;
import ca.odell.glazedlists.BasicEventList;

public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		MainWindow window = new MainWindow();
		window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

		BasicEventList<Message> messageEventList = new BasicEventList<Message>(
				20);

		JList messageList = new MessageJList(messageEventList);
		window.setMessageList(messageList);

		window.setVisible(true);

		CustomThreadPoolExecutor executor = new CustomThreadPoolExecutor(
				messageEventList);

		new Thread(executor).run();
	}
}